package com.example.networklab.mapper;

import com.example.networklab.domain.po.TaskHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 作业提交记录表 Mapper 接口
 * </p>
 *
 * @author dzw
 * @since 2025-02-27
 */
public interface TaskHistoryMapper extends BaseMapper<TaskHistory> {
    @Select("SELECT COUNT(*) FROM task_history WHERE task_id = #{taskId}" )
    Integer getSubmitCount(Long taskId);

    @Select("SELECT COUNT(DISTINCT user_id) FROM task_history WHERE task_id = #{taskId}" )
    Integer getStudentSubmitCount(Long taskId);
}
